﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:custom="clr-namespace:MIXer.Customization">
    <Style TargetType="{x:Type custom:TabPageControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type custom:TabPageControl}">
                    <Grid>
                        <ContentPresenter />
                        <Grid>
                            <Grid.Style>
                                <Style TargetType="Grid">
                                    <Setter Property="Visibility" Value="Visible" />
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding BusyMessage}" Value="{x:Null}">
                                            <Setter Property="Visibility" Value="Collapsed" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Grid.Style>
                            <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="DarkGray" Opacity=".7" />
                            <Border HorizontalAlignment="Center" VerticalAlignment="Center" Background="Gray" Padding="10" BorderBrush="Orange" BorderThickness="3" Width="250">
                                <StackPanel Orientation="Vertical">
                                    <TextBlock Text="{Binding BusyMessage}" Margin="5 5 5 5" TextWrapping="Wrap" HorizontalAlignment="Stretch" TextAlignment="Center" />
                                    <ProgressBar IsIndeterminate="True" Height="15" Margin="8 0 8 8" HorizontalAlignment="Stretch" />
                                </StackPanel>
                            </Border>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>